/*
	
	This script will recursively add all the
	McBuilds Mining Addon non-lua files to the
	download list.
	
	-Steeveeo
	
	NOTE: DO NOT ADD A GENERIC FOLDER LIKE "models/" OR "/materials/sprites"!
	THIS QUICKLY OVERLOADS THE DOWNLOADS TABLE AND CAUSES JOINCRASHES!
	If the necessary files are in a folder like this, use resource.AddFile lines instead!

*/

local function AddDir(dir) // recursively adds everything in a directory to be downloaded by client
	local list = file.FindDir("../"..dir.."/*")
	for _, fdir in pairs(list) do
		if fdir != ".svn" then // don't spam people with useless .svn folders
			AddDir(dir .. "/" .. fdir)
		end
	end
 
	for k,v in pairs(file.Find("../"..dir.."/*")) do
		resource.AddFile(dir.."/"..v)
	end
end

AddDir("sound/mcbuilds_mining/mining_laser")
AddDir("materials/effects/mining_beam")
AddDir("models/Tiberium")

//Tiberium Materials
resource.AddFile("materials/models/tib_shard.vmt")
resource.AddFile("materials/models/tiberium_b.vmt")
resource.AddFile("materials/models/tiberium_g.vmt")
resource.AddFile("materials/models/tiberium_goo.vmt")
resource.AddFile("materials/models/tiberium_normal.vmt")
resource.AddFile("materials/models/tiberium_r.vmt")
resource.AddFile("materials/models/white.vmt")

resource.AddFile("materials/models/tib_shard.vtf")
resource.AddFile("materials/models/tiberium_b.vtf")
resource.AddFile("materials/models/tiberium_g.vtf")
resource.AddFile("materials/models/tiberium_goo.vtf")
resource.AddFile("materials/models/tiberium_normal.vtf")
resource.AddFile("materials/models/tiberium_r.vtf")
resource.AddFile("materials/models/white.vtf")


AddCSLuaFile("../effects/mining_beam/init.lua")